home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat5 / prio.z / prio
Encoding:
Text File  |  1998-10-20  |  4.5 KB  |  133 lines

  1.  
  2.  
  3.  
  4. pppprrrriiiioooo((((5555))))                                                                pppprrrriiiioooo((((5555))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      prio - priority I/O
  10.  
  11. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  12.      Priority I/O (prio) refers to adding a "quality of service" to file
  13.      descriptors in the form of hardware bandwidth allocation and priority
  14.      request scheduling. The purpose of this mechanism is to manage the
  15.      sharing of scarce IO resources amongst competing processes, and to permit
  16.      a given process to reserve a portion of the system's resources for its
  17.      exclusive use for a period of time.
  18.  
  19.      Bandwidth allocation is operated on a file descriptor. Currently, the
  20.      file descriptor must point to a regular file. In the future more file
  21.      types may be added.  The data flow is assumed to be between memory and
  22.      the hardware device.  When an application makes a bandwidth allocation
  23.      request, each hardware component along the path will try to allocate
  24.      required bandwidth.  Any failure to allocate along the path causes the
  25.      entire allocation to fail. Given the limited nature of the bandwidth
  26.      resource, read and write are separate allocations.
  27.  
  28.      The sequence you use the API calls are: 1) if you want to do a series of
  29.      allocation and reallocation and don't want other applications to
  30.      interfere, do prioLock(); 2) request bandwidth allocation by doing
  31.      prioSetBandwidth(); 3) if you want to get bandwidth allocation
  32.      information, do prioGetBandwidth(); 4) if you did prioLock(), you must do
  33.      prioUnlock() to release the lock so that other applications can proceed
  34.      to get their bandwidth allocation. If an application forgets to release
  35.      the lock, the system will release the lock when the application
  36.      terminates.
  37.  
  38.      A regular file must be on a XFS file system, and do DIRECT I/O  (see
  39.      fcntl(5)) in order to use priority IO functionalities. If the file system
  40.      resides on a logical volume, it must be striped across all the disks in
  41.      the volume. On systems that don't have the bandwidth allocation hardware
  42.      , only priority scheduling is done.  The "priority" attribute obeys the
  43.      normal file attribute sharing semantics.
  44.  
  45.      Some amount of system configuration needs to be done before "priority
  46.      I/O" can be used on the file system. By default, the disk bandwidth is
  47.      assumed to be zero. A utility _d_i_s_k__b_a_n_d_w_i_d_t_h (see disk_bandwidth(1)) has
  48.      been provided which can be used to measure the disk bandwidth.  This must
  49.      be run on each disk on which "priority I/O" reservations are expected to
  50.      be made. After running _d_i_s_k__b_a_n_d_w_i_d_t_h also run _i_o_c_o_n_f_i_g (_1) in order to
  51.      avail of the just measured bandwidths. See disk_bandwidth(1) for some
  52.      cautionary notes before using the utility.
  53.  
  54. EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  55.           char *filename;
  56.           int fd, holder;
  57.  
  58.           fd = open(filename, O_RDONLY);
  59.           if (prioSetBandwidth(fd, PRIO_READ_ALLOCATE, 200000, &holder) < 0)
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. pppprrrriiiioooo((((5555))))                                                                pppprrrriiiioooo((((5555))))
  71.  
  72.  
  73.  
  74.           if (errno == ENOLCK) {
  75.                     printf("The lock holder is: %d\n", holder);
  76.                     exit(1);
  77.                }
  78.  
  79. NNNNOOOOTTTTEEEE
  80.      In IRIX 6.5, the Priority I/O APIs have been merged with the GRIO APIs.
  81.      As a result, the use of the Priority I/O APIs is deprecated. For
  82.      backwards compatibility, pppprrrriiiiooooSSSSeeeettttBBBBaaaannnnddddwwwwiiiiddddtttthhhh and pppprrrriiiiooooGGGGeeeettttBBBBaaaannnnddddwwwwiiiiddddtttthhhh are still
  83.      supported.  pppprrrriiiiooooLLLLoooocccckkkk and pppprrrriiiiooooUUUUnnnnlllloooocccckkkk are merely stubs. No locking or
  84.      atomicity is guaranteed. Please refer to grio(5) for further details.
  85.  
  86. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  87.      disk_bandwidth(1m), prio(3X), grio(5).
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.